home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
301-325
/
disk_311
/
incr
/
incr.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
5KB
|
105 lines
Program: incr
Programmer: George Kerber
Written: 07/24/89 - 08/06/89
Version: 1.03
Application: AmigaDOS
Purpose: This utility increment the value in a specified file by
one or create the file and save an initial value of 0 if
the file does not exist. incr will also display the
stored value un-incremented or before/after.
SYNTAX: incr [[-a|-b|-d -s -n -#] [path]filename ]
? Or no option, a help screen will be displayed.
-a The stored value will be displayed after
it has been incremented.
-b The stored value will be displayed before
incrementing the value.
-s The stored value will be displayed, the value
will not be incremented.
-n A newline will not we output.
-d The incr file will be unconditionally deleted.
(if exists, no warning messages are given.)
-1 White.
-2 Black.
-3 Orange.
-4 Default colors & attributes.
-5 Boldface.
-6 Underline.
-7 Italics.
Installation: Simply copy incr to your c: directory. Or execute
the install script called incr.install.
execute incr.install
Directions: Execute incr with a filename. If this filename doesn't
exist, incr will create the file and place a 0 in the file.
If the filename exists and contains a numeric value, the
value will be incremented and written back to the file.
CAUTION: incr only does simple checks on the specified
file to insure that it is really an incr file.
So if you give a filename that isn't an incr
file it may be overwritten. Too bad....
If you use the -s option, the value will simply be displayed
and the file will remain unchanged. Using either the
-a (after) or the -b (before) option will display the value
either before or after it has been incremented.
If the -n option is used, a newline will not be
performed after the value is displayed. This option
works the same as the NOLINE option for the AmigaDOS echo
command
If no path is given for the filename, incr will use the
s:incr directory for all files. If the directory doesn't
exist, incr will create it. Using a full pathname on the
filename will allow the user to specify where the file is
to be stored.
Examples: So what good is it?
Try adding these lines to your startup-sequence.
....
echo " You have booted from this disk " NOLINE
incr -a -n boot
echo " times before.
....
If you execute anything from a batch file, you can keep
track of the number of times you have executed the file.
-----------------------------------------------------------
What if you want a batch file to execute something every
20 times you run it? Use the boot.incr file you
created in the last example.
....
eval <s:incr/boot.incr >nil: to env:boot value2 20 op mod ?
if $boot eq 0 VAL
....
echo "it's time to do whatever you want done every"
echo "twenty times this disk is booted up"
....
endif
-----------------------------------------------------------
Get the idea.....
Status: This is public domain, but please keep me as author and
keep all the documentation intact. Anyway, if something
is wrong with this program, I'm not responsible.....
History: v1.00 Initial release.
v1.03 Added options and a default directory.